//    Openbravo POS is a point of sales application designed for touch screens.
//    Copyright (C) 2008-2009 Openbravo, S.L.
//    http://www.openbravo.com/product/pos
//
//    This file is part of Openbravo POS.
//
//    Openbravo POS is free software: you can redistribute it and/or modify
//    it under the terms of the GNU General Public License as published by
//    the Free Software Foundation, either version 3 of the License, or
//    (at your option) any later version.
//
//    Openbravo POS is distributed in the hope that it will be useful,
//    but WITHOUT ANY WARRANTY; without even the implied warranty of
//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//    GNU General Public License for more details.
//
//    You should have received a copy of the GNU General Public License
//    along with Openbravo POS.  If not, see <http://www.gnu.org/licenses/>.

package com.openbravo.pos.inventory;

import cn.ekuma.data.dao.I_DataLogic;
import cn.ekuma.data.ui.swing.SwingEditorRecord;
import cn.ekuma.epos.datalogic.I_DataLogicERP;
import cn.ekuma.epos.module.ERP_UI_Swing_Model;
import cn.ekuma.epos.panel.JPanelTableDAO;
import com.openbravo.bean.Attribute;
import com.openbravo.pos.base.AppLocal;
import java.awt.Component;

/**
 *
 * @author adrian
 */
public class AttributesPanel extends JPanelTableDAO<Attribute> {
    
    private AttributesEditor editor;
    private I_DataLogicERP m_dlSales;

    /** Creates a new instance of JPanelCategories */
    public AttributesPanel() {        
    }   
    
    protected void init() {          
        m_dlSales = mode.getDLERP();
        editor = new AttributesEditor(m_dlSales,dirty);
    }
    
    public SwingEditorRecord getEditor() {
        return editor;
    }  
    
    public String getTitle() {
        return AppLocal.getIntString("Menu.Attributes");
    }

    @Override
    public Component getFilter() {
        return null;
    }

    @Override
    public I_DataLogic getDataLogic() {
       return m_dlSales;
    }

    @Override
    public Class getSuportClass() {
        return Attribute.class;
    }

    @Override
    public String getObjectRenderString(Attribute obj) {
        return obj.getName();
    }

	@Override
	public String getModelName() {
		return ERP_UI_Swing_Model.MODEL_NAME;
	}
}
